package com.youyiwen.Interception;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author: zhaoyang
 * @Date: 2021/03/22
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    @Autowired
    private UserIntercepter intercepter;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {

        registry.addInterceptor(intercepter).addPathPatterns("/**").excludePathPatterns("/js/**","/css/**","/fonts/**",
                "/images/**","/js/**");
    }


}
